 package com.lj.mcore.entity;

  import com.lj.mcore.domain.IdEntity;
 import jakarta.persistence.*;
 import java.math.BigDecimal;



 @Entity
 @Table(name="shopping_goodscart")
 public class GoodsCart extends IdEntity
 {
 
   @OneToOne
   private Goods goods;
   private int count;
 
   @Column(precision=12, scale=2)
   private BigDecimal price;


   @ManyToOne(fetch=FetchType.LAZY)
   GoodsStock goodsStock;

   @Lob
   @Column(columnDefinition="LongText",name = "[key]")
   private String key;

   @Lob
   @Column(columnDefinition="LongText")
   private String spec_info;
 
   @ManyToOne(fetch=FetchType.LAZY)
   private OrderForm of;

   /**
    * 商品参与什么活动进行销售
    * 1 正常销售
    *
    */
   private String cart_type;

   @ManyToOne(fetch=FetchType.LAZY)
   private User user;

   @ManyToOne(fetch=FetchType.LAZY)
   Store store;

   /**
    * 库存是否已扣
    * 0 没有扣除
    * 1 库存已扣
    */
   @Column(columnDefinition="int default 0")
   int deduction;

   /**
    *
    *   0 添加进购物车
    *   1 已生成订单
    *
    */
   @Column(columnDefinition="int default 0")
   int status;

   @ManyToOne(fetch = FetchType.LAZY)
   StoreCart storeCart;

   public StoreCart getStoreCart() {
     return storeCart;
   }

   public void setStoreCart(StoreCart storeCart) {
     this.storeCart = storeCart;
   }

   public int getDeduction() {
     return deduction;
   }

   public void setDeduction(int deduction) {
     this.deduction = deduction;
   }

   public int getStatus() {
     return status;
   }

   public void setStatus(int status) {
     this.status = status;
   }

   public Store getStore() {
     return store;
   }

   public void setStore(Store store) {
     this.store = store;
   }

   public User getUser() {
     return user;
   }

   public void setUser(User user) {
     this.user = user;
   }

   public GoodsStock getGoodsStock() {
     return goodsStock;
   }

   public void setGoodsStock(GoodsStock goodsStock) {
     this.goodsStock = goodsStock;
   }

   public String getKey() {
     return key;
   }

   public void setKey(String key) {
     this.key = key;
   }

   public Goods getGoods() {
     return this.goods;
   }
 
   public void setGoods(Goods goods) {
     this.goods = goods;
   }
 
   public int getCount() {
     return this.count;
   }
 
   public void setCount(int count) {
     this.count = count;
   }
 
   public String getSpec_info() {
     return this.spec_info;
   }
 
   public void setSpec_info(String spec_info) {
     this.spec_info = spec_info;
   }
 
   public OrderForm getOf() {
     return this.of;
   }
 
   public void setOf(OrderForm of) {
     this.of = of;
   }
 
   public BigDecimal getPrice() {
     return this.price;
   }
 
   public void setPrice(BigDecimal price) {
     this.price = price;
   }
 
   public String getCart_type() {
     return this.cart_type;
   }
 
   public void setCart_type(String cart_type) {
     this.cart_type = cart_type;
   }
 }



 
 